package com.it.mapper;
import com.it.pro.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeptMapper {
    @Select("select * from dept")
    List <Dept> findAll();
    @Delete("delete from dept where id=#{id}")
    void deleteById(Integer id);
    @Insert("insert into dept values(#{id},#{name},now(),now())")
    void save(Dept dept);
    @Select("select * from dept where id=#{id}")
    Dept findById(Integer id);
    //修改
    @Update("update dept set name=#{name},update_time=now() where id=#{id}")
    void update(Dept dept);


}